Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

172
Vistas
What does ([, value]) => value mean ? d3.js

I'm working on d3.js, I am trying to make a stacked circles chart. I met some new stuff, like functions are defined

function myfct (xxx, {parameters}={}){ ... }

I interpreted the ", {}" part as the definition of optional parameters (? thanks for any further explanation on that)

My main question however is

chart = Pack(rollup, {
  value: ([, value]) => value,
  label: ([key]) => key?.split(/\s+/g).join("\n"),
  title: ([key], n) => `${n.depth 
    ? `${n.ancestors().reverse().slice(1).map(({data: [key]}) => key).join("\n")}\n`
    : ""}${n.value.toLocaleString("en")}`,
  width: 2000,
  height: 2000,
})

This is the code they use to call the chart function, I couldn't find someplace to understand the usage of [, value] and [key], so that I can use them for my own case ? If anyone could explain or point me where to look, would be of much help, thanks !

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda